home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 99
/
(Vol 99) Jan 19 2010.iso
/
Games
/
aeroplane.swf
/
scripts
/
DefineSprite_152
/
frame_1
/
DoAction.as
Wrap
Text File
|
2010-01-19
|
3KB
|
138 lines
score = 0;
wznoszenie = false;
sila = 0;
enemySpeed = 10;
shieldCounter = 0;
gramy = true;
this.onMouseDown = function()
{
if(gramy == true)
{
wznoszenie = true;
}
};
this.onMouseUp = function()
{
wznoszenie = false;
};
this.onEnterFrame = function()
{
if(shieldCounter >= 10 && hero.shield._currentframe == 1)
{
shield._y = random(200) + 50;
shield.play();
shieldCounter = 0;
}
if(hero._y >= 350)
{
gramy = false;
krasz.play();
}
_parent.score = score;
if(wznoszenie == true && gramy == true)
{
sila += 1;
}
else
{
sila -= 1;
}
hero._y -= sila;
hero._rotation = (- sila) * 2;
if(hero._y <= 0)
{
wysokosc = - math.round(hero._y / 10);
}
else
{
wysokosc = "";
}
i = 0;
while(i < 10)
{
var dat = eval("kolko" + i);
dat.onEnterFrame = function()
{
var _loc1_ = this;
_loc1_._x -= 10;
if(hero._visible == true)
{
if(_loc1_._x <= -10)
{
_loc1_._x = hero._x - 40;
_loc1_._y = hero._y;
}
}
if(gramy == false)
{
_loc1_.gotoAndStop(2);
}
};
i++;
}
i = 0;
while(i < 10)
{
var dat = eval("cloud" + i);
dat.onEnterFrame = function()
{
var _loc1_ = this;
_loc1_._x -= 15;
if(_loc1_._x <= -150)
{
_loc1_._x = 600;
_loc1_._y = random(300);
}
};
i++;
}
i = 0;
while(i < 10)
{
var dat = eval("coin" + i);
dat.onEnterFrame = function()
{
var _loc1_ = this;
_loc1_._x -= 10;
if(_loc1_._x <= -50)
{
_loc1_.gotoAndStop(random(6) + 1);
_loc1_._x = 500;
_loc1_._y = random(300);
}
if(_loc1_.hitTest(hero.tester))
{
_loc1_.gotoAndStop("taken");
score++;
shieldCounter++;
}
};
i++;
}
enemy._x -= enemySpeed;
enemySpeed += 0.003;
if(enemy._x <= -20)
{
enemy._x = 600;
enemy._y = random(300);
enemy.gotoAndStop(1);
}
if(enemy.hitTest(hero.tester) && enemy._currentframe == 1)
{
gramy = false;
enemy.play();
hero.play();
}
if(enemy.hitTest(hero.shield.tester) && enemy._currentframe == 1)
{
enemy.play();
hero.shield.gotoAndStop(1);
score += 10;
}
if(shield.hitTest(hero.tester))
{
shield.gotoAndStop(1);
hero.shield.gotoAndStop(2);
}
};